﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductEdit.ascx.cs" Inherits="ShopOnlineAdmin_ProductEdit" %>
<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Register Src="../Controls/TabsMenu/TabsMenu.ascx" TagName="TabsMenu" TagPrefix="uc1" %>
<%@ Register src="../Controls/UploadFile/UploadFile.ascx" tagname="UploadFile" tagprefix="uc1" %>
<div class="centerPanel">
    <uc1:TabsMenu ID="tabsMenu" runat="server" />
    <asp:Panel ID="pnlInfo" runat="server">
    <div class="webPanelBorder">
        <div class="webPanelCaption">产品基本信息</div>
        <div class="webPanelContent">
        <table cellspacing="1" class="table">
            <tr>
                <td class="tableSubjectWidth">产品名称：</td>
                <td ><asp:TextBox ID="tbSubject" runat="server" CssClass="shortInput" Width="400" ValidationGroup="record" MaxLength="50"></asp:TextBox><span class="requiredField">*</span></td>
                <td rowspan="11" style="width:30%;">
                    <asp:Panel ID="Panel1" runat="server" Height="250px" Width="260px" ScrollBars="Auto">
                        <asp:Image ID="imgProduct" runat="server" />
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>产品运费：</td>
                <td><asp:TextBox ID="tbFreightCost" runat="server" CssClass="shortInput" Width="400" MaxLength="50">快递:20.0元</asp:TextBox></td>
            </tr>
            <tr>
                <td>淘宝地址：</td>
                <td><asp:TextBox ID="tbTaobaoURL" runat="server" CssClass="shortInput" Width="400" MaxLength="254"></asp:TextBox></td>
            </tr>
            <tr>  
                <td>产品编号：</td>
                <td><asp:TextBox ID="tbProductCode" runat="server" CssClass="shortInput" Width="150"></asp:TextBox></td>
            </tr>
            <tr>
                <td>类别：</td>
                <td>
                    <ofcc:DropDownList ID="ddlCategory" runat="server" Width="155px">
                    </ofcc:DropDownList>
                </td>
            </tr>
            <tr>
                <td>销售价格：</td>
                <td><ofcc:TextBox ID="tbListPrice" runat="server" CssClass="shortInput" Width="150"></ofcc:TextBox></td>
            </tr>
            <tr>
                <td>库存数量：</td>
                <td><ofcc:TextBox ID="tbInventory" runat="server" CssClass="shortInput" Width="150"></ofcc:TextBox></td>
            </tr>
            <tr>
                <td>标签：</td>
                <td><asp:TextBox ID="tbTag" runat="server" CssClass="shortInput" Width="150"></asp:TextBox></td>
            </tr>
            <tr>
                <td></td>
                <td><ofcc:CheckBox ID="cbPublished" Text="产品上架" runat="server" Checked="True" />
                <ofcc:CheckBox ID="cbAllowFeedback" Text="允许评论"  runat="server" Checked="True" />
                </td>
            </tr>                       
        </table>        
        </div>
    </div>   
    </asp:Panel>    
    <asp:Panel ID="pnlContent" runat="server">        
    <div class="webPanelBorder">
        <div class="webPanelCaption">产品介绍信息</div>
        <div class="webPanelContent">
        <table cellspacing="1" class="table"> 
            <tr>
                <td>缩略图片：</td>
                <td><asp:TextBox ID="tbHotImageFileName" runat="server" CssClass="shortInput" Width="400"></asp:TextBox> (310*210px)
                </td>                
            </tr>     
            <tr>
                <td class="tableSubjectWidth">产品内容：</td>
                <td>
                <FTB:FreeTextBox id="freeTextBox" runat="Server" 
                    ToolbarImagesLocation="ExternalFile"
                    JavaScriptLocation ="ExternalFile"
                    SupportFolder="~/Controls/FreeTextBox/"
                    DesignModeCss="designmode.css"
                    Language="zh-cn"
                    Width="800px"
                    OnSaveClick="btnSave_Click"              
                    toolbarlayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker;JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;Bold,Italic,Underline,Strikethrough;Undo,Redo;InsertDate,InsertTime,InsertTable,InsertImageFromGallery" 
		            />
                </td>
            </tr>
        </table>
        </div>
    </div>		           
    </asp:Panel>

    
    <div class="webPanelButtonArea">
        <span class="linkButtonOut"><asp:LinkButton ID="btnSave" runat="server"  CssClass="linkButton" 
            OnClick="btnSave_Click" OnClientClick="closePop();" ValidationGroup="record">保存发布</asp:LinkButton></span>
        <span class="linkButtonOut" id="btnUpload" style="display:none;"><asp:LinkButton ID="btnUpload" runat="server"  CssClass="linkButton" 
            OnClientClick="return false" ValidationGroup="record">批量上传</asp:LinkButton></span>        
        <span class="linkButtonOut"><asp:LinkButton ID="btnClear" runat="server"  CssClass="linkButton" 
            OnClientClick="return clearFTB();" OnClick="btnClear_Click" >清除</asp:LinkButton></span>
    </div>
    </div>  
    <asp:HiddenField ID="hfID" runat="server" />
    <asp:HiddenField ID="hfAddOrEdit" runat="server" />
    <uc1:UploadFile ID="UploadFile1" runat="server"  />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbSubject"
        Display="None" ErrorMessage="请输入产品名称!" ValidationGroup="record"></asp:RequiredFieldValidator>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableViewState="False" ShowMessageBox="True"
            ShowSummary="False" ValidationGroup="record" />     
    <script type="text/javascript">
    //IE
    if(Prototype.Browser.IE)
    {
        document.body.onunload = function(){
            closePop();
        }
    }
    else
    {
        //FF
        window.onunload = function(){
            closePop();
        }
    }


    function closePop()
    {
        if (FTB_API['<%=freeTextBox.ClientID %>'].Gallery() != null &&
        FTB_API['<%=freeTextBox.ClientID %>'].Gallery().closed == false)
        {
            FTB_API['<%=freeTextBox.ClientID %>'].Gallery().close();
        }
    }

    function clearFTB() {
        if (confirm('确定要清除吗?')) {
            FTB_API['<%=freeTextBox.ClientID %>'].htmlEditor.innerText = "";
            FTB_API['<%=freeTextBox.ClientID %>'].designEditor.document.body.innerHTML = "";
        }
        return false;
    }
    </script>